package com.otojob.service;

import com.otojob.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;
import com.otojob.utils.Results;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author TingFeng
 * @since 2022-03-18
 */
public interface UserService extends IService<User> {
    /**
     * 修改电话
     * @param telephone
     * @return
     */
    @CacheEvict(key = "#id",value = "User")
    Results updateUserTelephone(String telephone,int id);

    /**
     * 修改昵称
     * @param nikename
     * @return
     */
    @CacheEvict(key = "#id",value = "User")
    Results updateNikeName(String nikename,int id);

    /**
     * 修改头像路径
     * @param url
     * @return
     */
    @CacheEvict(key = "#id",value = "User")
    Results updatePhoto(String url,int id);

    /**
     * 修改宣言
     * @param declaration
     * @return
     */
    @CacheEvict(key = "#id",value = "User")
    Results updateDeclaration(String declaration,int id);

    /**
     * 修改性别
     * @param sex
     * @return
     */
    @CacheEvict(key = "#id",value = "User")
    Results updateUserSex(Integer sex,int id);

    /**
     * 查询简历是否存在
     * @return
     */
    Results findMyResumeTF();

    /**
     * 添加简历url
     * @param url
     * @return
     */
    Results addResume(String url);

    /**
     * 删除简历
     * @return
     */
    Results deleteResume();

    /**
     * 查询用户详细
     * @return
     */
    @Cacheable(key = "#id",value = "User")
    Results findUserById(int id);

    /**
     * get用户简历
     * @return
     */
    Results getResume();
}
